<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			#show{
				color:skyblue;
				cursor: pointer;
			}
		</style>
		<script>
			function showPass(t){
				if(document.getElementById("upass").type=="text"){
					document.getElementById("upass").type="password";
					t.innerHTML="查看密码"; 
				}else{
					document.getElementById("upass").type="text";
					t.innerHTML="隐藏密码"; 
				}
				
				
			}
		</script>
	</head>
	<body>
		<form>
			<p>
				用户名:<input type="text" name="uname"/>
			</p>
			<p>
				密码:<input type="password" name="upass" id="upass"/>
				<span id="show" onclick="showPass(this)">查看密码</span>
			</p>
		</form>
	</body>
</html>